package com.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * @author lenovo
 * @Description
 * @Date2025-2-26 17:36
 * 数据库连接
 */
public class DBUtil {
    public static final String URL = "jdbc:mysql://localhost:3306/mysqldb?serverTimezone=GMT";
    public static final String USER = "root";
    public static final String PASSWORD = "123456";

    public static Connection getConnection() throws SQLException {
        return DriverManager.getConnection(URL, USER, PASSWORD);
    }
}
